using Unity.Entities;
using UnityEngine;

public class RangeDamageAuthoring : MonoBehaviour
{
    public int range;
    public Faction faction;
    public float timerMax;
    public float lifeTime;
    public class Baker : Baker<RangeDamageAuthoring>
    {
        public override void Bake(RangeDamageAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.Dynamic);
            AddComponent(entity, new RangeDamage
            {
                range = authoring.range,
                faction = authoring.faction,
                timerMax = authoring.timerMax,
                lifeTime= authoring.lifeTime,
            });
        }
    }
}

public struct RangeDamage : IComponentData
{
    public int range;
    public Faction faction;
    public float timer;
    public float timerMax;
    public float lifeTime;
}
